package com.sophialex.health.record.common.bind.swt.convertors;

import java.util.Date;

import org.apache.commons.httpclient.util.DateUtil;
import org.eclipse.core.databinding.conversion.IConverter;


public class DateToStringConvertor implements IConverter {
	private static final String DATE_TYPE_SIMPLE = "yyyy-DD-mm";
	public Object convert(Object fromObject) {
		Date d = (Date)fromObject;
		return DateUtil.formatDate(d, DATE_TYPE_SIMPLE);
	}

	public Object getFromType() {
		return new Date();
	}

	public Object getToType() {
		return "";
	}

}
